<?php
/* @var $this OrderController */
/* @var $data Order */
$product_sum = count($data->orderProduct);

$ordproduct_status=array(
		'0'=>'正常',
		'1'=>'已退款',
		'2'=>'退款中',
		);
$status = array(
		'1'=>'确认订单',
		'2'=>'交易关闭',
		'3'=>'完成订单',
		);
$expStatus = array(
		'1'=>'待发货',
		'2'=>'等待买家收货',
		'3'=>'换货成功',
		'4'=>'申请换货',
		'5'=>'确认收货',
);
$payStatus = array(
		'1'=>'等待买家付款',
		'2'=>'已支付',
		'3'=>'退款成功',
		'4'=>'申请退款',
);
$comment = array(
		'1'=>'双方都未互评',
		'2'=>'买家已评价',
		'3'=>'卖家已评价',
		'4'=>'双方已互评',
		);
?>

		<tr class="blank">
			<td colspan="8"></td>
		</tr>
		<tr class="shop">
			<td colspan="8" class="tl">
				<span class="ml">
					<input class="chk" type="checkbox" name="">
					订单编号：<?php echo CHtml::encode($data->zo_id)?>
				</span>
				<span class="ml">
					<?php if($data->zo_status==3){?>
						成交时间：<?php echo CHtml::encode($data->zo_voer_time); ?>
					<?php }else{ ?>
						下单时间：<?php echo CHtml::encode(date('Y-m-d H:m:s', $data->zo_create_time)); ?>
					<?php } ?>
				</span>
			</td>
		</tr>
		<tr>
			<td class="pro tl">
				<div class="c_img c_img50">
					<?php echo CHtml::link(Tool::thumb($data->orderProduct[0]->zop_pic,50,50),array('/home/product/detail','id'=>$data->orderProduct[0]->zp_id))?>
				</div>
				<p class="title_pro line_18">
					<?php echo CHtml::link(str_cut($data->orderProduct[0]->zop_title,40),array('/home/product/detail','id'=>$data->orderProduct[0]->zp_id),array('class'=>'c_06c'))?>
				</p>
				<p class="other c_999">
					<?php $spec = unserialize($data->orderProduct[0]->zop_spe);
						if(is_array($spec)){foreach($spec as $key=>$val){
						  echo "<span class='mr10'>".$key."：".$val."</span>";
						}}
					?>
				</p>
			</td>
			<td class="no_blr" width="7%">
				<?php echo $data->orderProduct[0]->zop_real_price ?>
			</td>
			<td class="no_blr" width="5%">
				<?php echo $data->orderProduct[0]->zop_nums ?>
			</td>
			<td class="no_blr" width="9%">
				<?php if($data->zo_pay_status==3||$data->zo_pay_status==4) echo $ordproduct_status[$data->orderProduct[0]->zop_status] ?>
			</td>
			<td width="12%" <?php if(($product_sum>1)) echo "rowspan=$product_sum" ?> >
				<span class="c_06c d_b"><?php echo CHtml::encode($data->member->zm_name); ?></span>
				<?php if(!empty($data->member->more)&&!empty($data->member->more->zmp_qq)) echo CHtml::link(CHtml::image("http://wpa.qq.com/pa?p=1:{$data->member->more->zmp_qq}:47"),"http://wpa.qq.com/msgrd?V=1&amp;Uin=".$data->member->more->zmp_qq."&amp;Menu=yes",array('target'=>'_blank'))?>
			</td>
			<td width="12%" <?php if(($product_sum>1)) echo "rowspan=$product_sum" ?> >
				<?php if($data->zo_status==1 &&($data->zo_pay_status==1||$data->zo_pay_status==4)) echo CHtml::link($payStatus[$data->zo_pay_status],'',array('class'=>'d_b c_f60')) //支付状态?>
				<?php if($data->zo_pay_status==2 &&($data->zo_status==1||$data->zo_status==2||$data->zo_status==4)) echo CHtml::link($expStatus[$data->zo_exp_status],'',array('class'=>'d_b')) //物流状态?>
				<?php echo CHtml::link(Yii::t('cmp','Detail'),array($this->pre_module_url.'/order/detail','id'=>$data->zo_id),array('class'=>'d_b c_f60')) //查看详情?>
				<?php if($data->zo_status==2||$data->zo_status==3) echo CHtml::link($status[$data->zo_status],'',array('class'=>'d_b')) //订单状态?>
			</td>
			<td width="15%" <?php if(($product_sum>1)) echo "rowspan=$product_sum" ?> >
				<span class="fw_b d_b"><?php echo CHtml::encode($data->zo_amount); ?></span>
				<span class="c_999 d_b">（含快递：<?php echo CHtml::encode($data->zo_real_freight); ?>）</span>
			</td>
			<td width="9%" <?php if(($product_sum>1)) echo "rowspan=$product_sum"; ?> >
				<?php //if($data->zo_pay_status==1) echo CHtml::link(Yii::t('cmp','updatePrice'),'javascript:',array('onclick'=>"return updatePrice('".$data->zo_id."')",'class'=>'mem_btn mem_btn02 d_b')) //修改订单价格?>
				<?php //if($data->zo_pay_status==2 && $data->zo_exp_status==1) echo CHtml::link(Yii::t('cmp','delivery'),array($this->pre_module_url.'/order/delivery',array('id'=>$data->zo_id)),array('class'=>'mem_btn mem_btn02 d_b')) //发货?>
				<?php //if($data->zo_status==3 && ($data->zo_comment==1||$data->zo_comment==2)) echo CHtml::link(Yii::t('cmp','comment'),array($this->pre_module_url.'/ordcomment/comment/',array('id'=>$data->zo_id)),array('class'=>'mem_btn mem_btn02 d_b')) //评价?>
				<?php //if($data->zo_status==3 && ($data->zo_comment==3||$data->zo_comment==4)) echo CHtml::encode($comment[$data->zo_comment]); //评论状态?>
			</td>
		</tr>
		<?php if (($product_sum>1)){for($i=1;$i<$product_sum;$i++){?>
		<tr>
			<td class="pro tl">
				<div class="c_img c_img50">
					<?php echo CHtml::link(Tool::thumb($data->orderProduct[$i]->zop_pic,50,50),array('/home/product/detail',array('id'=>$data->orderProduct[$i]->zp_id)))?>
				</div>
				<p class="title_pro line_18">
					<?php echo CHtml::link(str_cut($data->orderProduct[$i]->zop_title,40),array('/home/product/detail',array('id'=>$data->orderProduct[$i]->zp_id)),array('class'=>'c_06c'))?>
				</p>
				<p class="other c_999">
					<?php $spec = unserialize($data->orderProduct[$i]->zop_spe);
						foreach($spec as $key=>$val){
						  echo "<span class='mr10'>".$key."：".$val."</span>";
						}
					?>
				</p>
			</td>
			<td class="no_blr">
				<?php echo $data->orderProduct[$i]->zop_real_price ?>
			</td>
			<td class="no_blr">
				<?php echo $data->orderProduct[$i]->zop_nums ?>
			</td>
			<td class="no_blr">
				<?php if($data->zo_pay_status==3||$data->zo_pay_status==4) echo $ordproduct_status[$data->orderProduct[$i]->zop_status] ?>
			</td>
		</tr>
		<?php }}?>
